package applogic;

public class Network {
	private Receiver receiver;
	public Network(Receiver receiver)
	{
		this.receiver = receiver;
	}
	
	public void receiveMessage(String msg)
	{
		Message message = new Message(msg);
		receiver.receiveMessage(message);
	}
	
	public void sendMessage(Message message)
	{
		/*TODO*/
		
		if(message.getTarget()==0)
		{
			CalenderServer.server.receiveMessage(message);
		}
		else
		{
			CalenderClient.client.receiveMessage(message);
		}
	}
	
	public void setServer(CalenderServer server)
	{
	}
}
